<template>
    <div>
        <match-detail :data="race_detail"></match-detail>
        <div class="divider"></div>
        <div class="brnWrap">
            <div v-if="isHistory">
                <!--<el-button @click="releaseAgain()" type="primary">再次发起赛事</el-button>-->
            </div>            
            <div v-else>
                <!--<router-link v-if="race_detail.status == 2 || (race_detail.status==3&& Date.now() < race_detail.signStartTime)" 
                    :to="{ path:'/race/detail/index/edit?id='+$route.query.id}">
                    <el-button type="primary">编辑赛事资料</el-button>
                </router-link>   
                -->             
                <el-button v-if="race_detail.status==1" class="disabled">审核中</el-button>
            </div>
        </div>
    </div>
</template>

<script>
  import { mapGetters } from 'vuex'
  import MatchDetail from './components/MatchDetail'
  export default {
    components: {
      MatchDetail
    },
    computed: {
      isHistory () {
        return this.$route.path.indexOf('history') > -1
      },
      ...mapGetters({
        race_preview_form: 'race_preview_form',
        race_detail: 'race_detail'
      })
    },
    data () {
      return {}
    },
    methods: {
      releaseAgain () {
        let type = ''
        switch (this.race_detail.matchType) {
          case 3001: type = 'football'; break
          case 3002: type = 'basketball'; break
          case 3003: type = 'badminton'; break
          case 3004: type = 'tennis'; break
          case 3005: type = 'pingpang'; break
          case 3006: type = 'run'; break
        }
        this.$store.commit('HISTORY_RACE', this.race_detail)
        this.$store.commit('HISTORY_HAVE', true)
        this.$router.push({path: '/race/release/' + type})
      }
    }
  }
</script>

<style rel="stylesheet/scss" lang="scss">
.info-item {
    margin-bottom: 50px;
}

.grid-content {
  ul {
    display: inline-block;
    li {
      float: left;
      margin-right: 25px;
      &:last-child {
          margin-right: 0;
      }
    }
  }
}

p.remark, label.mark {
  line-height: 26px;
}

p {
  &.remark {
      padding-left: 80px;
  }
}

.brnWrap {
    text-align: center;
    padding: 40px 0;
}

.el-button {
  &.disabled {
    background: #ddd;
    color: #fff;
    min-width: 150px;
    border: none;
    cursor: not-allowed;
  }
}

.el-carousel__item {
    text-align: center;
}

</style>
